package com.gs.disk.dao.admin;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.gs.common.mapper.CommonMapper;
import com.gs.disk.dto.admin.UserDto;
import com.gs.entity.UserEntity;
import org.apache.ibatis.annotations.Mapper;

@Mapper
public interface UserDao extends CommonMapper<UserEntity, UserDto> {

    /**
     * 根据用户id获取用户信息
     * @param userName
     * @return
     */
    default UserEntity getByUserName(String userName) {
        QueryWrapper<UserEntity> wrapper = new QueryWrapper<>();
        wrapper.eq("name", userName);
        return this.selectOne(wrapper);
    }

}